unit Smfef;

interface

uses
  SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  Forms, Dialogs, StdCtrls, Mask, Buttons;

type
  TFieldEditor = class(TForm)
    BAcept: TBitBtn;
    BCancel: TBitBtn;
    EName: TMaskEdit;
    ESize: TMaskEdit;
    EDecs: TMaskEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
  private
    { Private declarations }
    procedure SetName( const n: string );
    function GetName: string;
    procedure SetSize( s: integer );
    function GetSize: integer;
    procedure SetDecimals( d: integer );
    function GetDecimals: integer;
  public
    { Public declarations }
    function Execute( const title: string ): boolean;
    property Name: string read GetName write SetName;
    property Size: integer read GetSize write SetSize;
    property Decimals: integer read GetDecimals write SetDecimals;
  end;

implementation

{$R *.DFM}

uses
  StrUtils;

function TFieldEditor.Execute( const title: string ): boolean;
begin
  Caption := title;
  result := ShowModal=mrOk;
end;

procedure TFieldEditor.SetName( const n: string );
begin
  EName.Text := n;
end;

function TFieldEditor.GetName: string;
begin
  result := EName.Text;
end;

procedure TFieldEditor.SetSize( s: integer );
begin
  ESize.Text := IntToStr(s);
end;

function TFieldEditor.GetSize: integer;
begin
  result := StrToIntDef(Trim(ESize.Text),0);
end;

procedure TFieldEditor.SetDecimals( d: integer );
begin
  EDecs.Text := IntToStr(d);
end;

function TFieldEditor.GetDecimals: integer;
begin
  result := StrToIntDef(Trim(EDecs.Text),0);
end;

end.
